package com.qut.atcoder.controller;

import com.qut.atcoder.mappers.CourseMapper;
import com.qut.atcoder.pojo.Course;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class CourseController {
    @Autowired(required = false)
    private CourseMapper courseMapper;

    //通过编号查找题目
    @ResponseBody
    @RequestMapping("getCourseById")
    public List<Course> getCourseById(@RequestBody Course course) {
        return courseMapper.selectById(course);
    }
}
